-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add the unparam linter to golangci and fix those issues flagged #643
add the unparam linter to golangci and fix those issues flagged #643
Conversation
✅ Deploy Preview for kubernetes-sigs-jobset canceled.
|
885f91c
to
f1fc56f
Compare
pkg/webhooks/jobset_webhook.go
Outdated
@@ -382,7 +382,7 @@ func validateCoordinator(js *jobset.JobSet) error { | |||
|
|||
// replicatedJobByName fetches the replicatedJob spec from the JobSet by name. | |||
// Returns nil if no replicatedJob with the given name exists. | |||
func replicatedJobByName(js *jobset.JobSet, replicatedJob string) *jobset.ReplicatedJob { | |||
func replicatedJobByName(js *jobset.JobSet) *jobset.ReplicatedJob { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like in #627 the replicatedJobByName
function had a bug that was missed. We should keep the replicatedJob
string param for this function, but on line 387 it should say:
if rjob.Name == replicatedJob {
...
}
rather than hardcoding the rjob.Name == js.spec.coordinator.replicatedJob. The coordinator replicatedJob is being passed in as a param by the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk. Feel free to propose a PR to fix that bug. I'll add this in after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, just created #645 with the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with your fix.
f1fc56f
to
c1e2ace
Compare
/lgtm Thanks for adding this! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danielvegamyhre, kannon92 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
add linter for unused parameters.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?